//跳转刷新
window.addEventListener("pageflowrefresh", function (e) {
    location.reload();
});



//创建MeScroll对象
//function initMescroll(mescrollId,clearEmptyId){

function initMescroll(mescrollId){
    $("body").addClass("body-bg");//mescroll对iOS背景解决
    var mescroll = initMeScroll(mescrollId, {
        down:{
            auto:false,//是否在初始化完毕之后自动执行下拉回调callback; 默认true
            callback: downCallback, //下拉刷新的回调
        },
        up: {
            auto:true,//初始化完毕,是否自动触发上拉加载的回调
            isBoth: true, //上拉加载时,如果滑动到列表顶部是否可以同时触发下拉刷新;默认false,两者不可同时触发; 这里为了演示改为true,不必等列表加载完毕才可下拉;
            callback:upCallback, //上拉加载的回调
            toTop:{ //配置回到顶部按钮
                src : "img/mescroll-totop.png", //默认滚动到1000px显示,可配置offset修改
                //offset : 1000
            },
//          clearEmptyId:clearEmptyId
        }
    });
    return mescroll
}
//上拉加载回调
function upCallback(page){
    if(curNavIndex==1){//获取新闻tab1
        var cid=$('#cloumn-list').find('.selected').data('id')
        var getnewsdata={
            title:'获取新闻列表',
            url:'news/listNews',
            sendData:{"pageSize":page.size,"pageNo":page.num,colid:cid},
            fromwho:'news'
        }
        getAjaxScorll(getnewsdata,
            function(data){
                if(data.result==1){
                    var curPageData=data.data.list
                    mescroll.endSuccess(curPageData.length);
                    setNewsData(curPageData,cid,true)
                }else{
                    var html=`
                    <div class="swiper-slide swiper-no-swiping">
                        <p class="noContent">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-jingcha"></use>
                            </svg>  
                            <label for="">暂无内容</label>
                        </p>
                    </div>`
                   $('#news-list .data-list[data-cid='+cid+']').html(html);//加在列表的前面,下拉刷新
                   mescroll.endErr(); 
                }
            },
            function(){
                mescroll.endErr();
            }
        )
    }
    if(curNavIndex==2){//司法救助tab2
        var getjudiciarydata={
            title:'获取司法列表',
            url:'news/listNews',
            sendData:{"pageSize":page.size,"pageNo":page.num,ident:'mzzj'},
            fromwho:'news'
        }
        getAjaxScorll(getjudiciarydata,
            function(data){
                if(data.result==1){
                    var curPageData=data.data.list
                    mescroll.endSuccess(curPageData.length);
                    setJudiciaryData(curPageData,true)
                }else{
                    var html=`
                    <div class="swiper-slide swiper-no-swiping">
                        <p class="noContent">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-jingcha"></use>
                            </svg>  
                            <label for="">暂无内容</label>
                        </p>
                    </div>`
                    $('#sfjzList').html(html);//加在列表的前面,下拉刷新
                    mescroll.endErr();
                }
            },
            function(){
                mescroll.endErr();
            }
        )
    }
}
//下拉刷新回调
function downCallback(){
    if(curNavIndex==1){//获取新闻tab1
        var cid=$('#cloumn-list').find('.selected').data('id')
        var getnewsdata={
            title:'获取新闻列表',
            url:'news/listNews',
            sendData:{"pageSize":10,"pageNo":1,colid:cid},
            fromwho:'news'
        }
        getAjaxScorll(getnewsdata,
            function(data){
                if(data.result==1){
                    var curPageData=data.data.list
                    setNewsData(curPageData,cid,false)
                    $("#downloadTip").css("top","44px");
                    
                }else{
                    var html=`
                    <div class="swiper-slide swiper-no-swiping">
                        <p class="noContent">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-jingcha"></use>
                            </svg>  
                            <label for="">暂无内容</label>
                        </p>
                    </div>`
                    $('#news-list .data-list[data-cid='+cid+']').html(html)
                    $('#sfjzList').html(html);
                }
                mescroll.endSuccess();
            },
            function(){
                mescroll.endErr();
            }
        )
    }
    if(curNavIndex==2){
        var getjudiciarydata={
            title:'获取司法列表',
            url:'news/listNews',
            sendData:{"pageSize":10,"pageNo":1,ident:'sfjz'},
            fromwho:'news'
        }
        getAjaxScorll(getjudiciarydata,
            function(data){
                if(data.result==1){
                    var curPageData=data.data.list
                    setJudiciaryData(curPageData,false)
                    $("#downloadTip").css("top","44px");
                }else{
                    var html=`
                    <div class="swiper-slide swiper-no-swiping">
                        <p class="noContent">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-jingcha"></use>
                            </svg>  
                            <label for="">暂无内容</label>
                        </p>
                    </div>`
                    $('#sfjzList').html(html);
                }
                mescroll.endSuccess();
            },
            function(){
                mescroll.endErr();
            }
        )
    }
}
//swiper切换效果
//var swiper1,swiper2
function setNewsSwiper(){
    var swiper1 = new Swiper('.swiper1', {
        passiveListeners : false,
        slidesPerView:'auto',
        paginationClickable: true,//此参数设置为true时，点击分页器的指示点分页器会控制Swiper切换。
        spaceBetween: 10,//slide之间的距离（单位px）。
        freeMode: true,//默认为false，普通模式：slide滑动时只滑动一格，并自动贴合wrapper，设置为true则变为free模式，slide会根据惯性滑动且不会贴合。
        loop: false,//是否可循环
        onTab: function(swiper) {
            var n = swiper1.clickedIndex;
        }
    });
    var swiper2 = new Swiper('.swiper2', {
        passiveListeners : false,
        direction: 'horizontal',//Slides的滑动方向，可设置水平(horizontal)或垂直(vertical)。
        loop: false,
        autoHeight: true,//自动高度。设置为true时，wrapper和container会随着当前slide的高度而发生变化。
        onlyExternal : true,
    });
    swiper1.slides.each(function(index, val) {
        var ele = $(this);
        ele.on("click", function() {
            setCurrentSlide(ele, index);
            console.log(index)
            swiper2.slideTo(index, 500, false);
        });
    });
    function setCurrentSlide(ele, index) {
        $(".swiper1 .swiper-slide").removeClass("selected");
        ele.addClass("selected");
    }
}



/****初始化****/
var mescroll
var curNavIndex=1 //滚动加载标签,0=tab1
var curTab='tab1' //当前tab标签
pageGetData(curTab) //ajax获取tab下的相关数据
mescroll=initMescroll("mescroll1")//初始化
/****初始化end****/
/************底部导航跳转**********/
$('.mui-bar').on('tap','.mui-tab-item',function(){
    if($(this).attr('id')!=curTab){
        curTab=$(this).attr('id')
        if(curTab!='tab1'){
            pageGetData(curTab)//重新渲染数据
        }
        if($(this).attr('i')){
            curNavIndex=$(this).attr('i') 
            mescroll.destroy();
            mescroll=initMescroll("mescroll"+curNavIndex);
            //      mescroll=initMescroll("mescroll"+curNavIndex, "dataList"+curNavIndex);
        }
    }
})
/************底部导航跳转end**********/
/************获取数据对象**********/
function pageGetData(tabIndex){
    /*
     ** tab1**
     */
    if(tabIndex=='tab1'){
        /*********获取所有栏目*************/
        var getAllColumnData={
            url:'column/listColumn',
            sendData:{"pageSize":1000},
            fromwho:'news',
        }
        getAjaxSyn(getAllColumnData,
            function(data){
                if(data.result==1){
                    var curData=data.data.list
                    var topData=[]
                    $.each(curData,function(k,v){
                        if(v.parentid==0&&!v.seminarid&&v.columnident!='sfjz'){
                            topData.push(v)
                        }
                    })
                    setColumnList(topData)
                    if(typeof swiper1!='object'){
                        setNewsSwiper()
                    }
                    
                }else{
                    mui.toast('获取栏目失败')
                }
            }, 
            function(data){
                mui.toast('获取栏目失败，服务器出错')
            }
        )
        function setColumnList(curData){
            var html1,html2
            if(curData.length==0){
                html1 = '<tr><td colspan="8">暂无数据</td></tr>';
            }else{
                var tplData={curData:curData}
                html1= template('tpl-cloumnList', tplData);
                html2 = template('tpl-newsListDiv', tplData);
                $('#cloumn-list').html(html1);
                $('#news-list').html(html2);
                
            }
        }
        /************新闻类型点击渲染**********/
        $('#cloumn-list>.swiper-slide').on('click',function(){
            mescroll.setPageNum(1);
            if(!$(this).hasClass('has')){
                $(this).addClass('has')
                mescroll.triggerUpScroll();
            }
           
        })
        /************新闻类型点击渲染end**********/
        /*********获取所有栏目end*************/
    }
    /*
     ** tab3**
     */
    if(tabIndex=='tab3'){
        var getTypeData={
            url:'index/listDictionary',
            fromwho:'lj',
            sendData:{
                tag:'zxjb'
            }
        }
        getAjax(getTypeData,
            function(data){
                var html=`<option value="0">请选择控告类型</option>`
                if(data.result==1){
                    var curData=data.data
                    $.each(curData,function(k,v){
                        html+=`
                        <option value="${v.tag}">${v.name}</option>
                        `
                    })
                }else{
                    
                }
                $('#type').html(html)
            }, 
            function(data){
                alert('服务器出错')
            }
        )
        var issid={
            url:'user/ssoLogin',
            type:"get",
            fromwho:'ch'
        }
        getAjax(issid,
            function(data){
                var isnouser=false
                var islogin=false
                var isarea=0
                if(data.result==1){
                   islogin=true
                   $(".jbMain span.smallTitle.xm,.jbMain p.selectBox.xm,.jbMain span.smallTitle.hm,jbMain p.selectBox.xm,.jbMain p.selectBox.hm").remove()
                   if(!userInfo.areaid){
                        getAreaTree()
                   }else{
                       $('.area-div').remove()
                       isarea=userInfo.areaid
                   }
                }else{
                     getAreaTree()
                     mui.toast('登录已经失效')
                }
                mui('.mui-input-row.mui-checkbox.mui-left').on('change', 'input', function() {
                    isnouser=this.checked
                    if(isnouser){
                        $('.name-phone').fadeOut()
                    }else{
                        $('.name-phone').fadeIn()
                    }
                });
                //上传图片
                mui.plusReady(function() {
                     mui(".mui-content").on('tap','.addImg',function(){
                        showActionSheet(this)
                    })
                })
                //提交数据
                mui(".mui-content").on('tap','.submitJb',function(){
                    var user,phone,report_type,area_id,description_info
                    var report_type=$('#type').val()
                    var description_info=$('#description_info').val()
                    if(islogin&&isnouser){
                       user='' 
                       phone=''
                       area_id=isarea ? isarea : $('#selceted-areaid').val()
                    }
                    if(islogin&&!isnouser){
                       user=userInfo.realname ? userInfo.realname :  userInfo.userid
                       phone=userInfo.mtel?userInfo.mtel:13999999999
                       area_id=isarea ? isarea.toString() : $('#selceted-areaid').val()
                    }
                    if(!islogin&&isnouser){
                       user='' 
                       phone=''
                       area_id=$('#selceted-areaid').val()
                    }
                    if(!islogin&&!isnouser){
                       user=$('#user').val()
                       phone=$('#phone').val()
                       area_id=$('#selceted-areaid').val()
                    }
                    if(!isnouser){
                        if(!user){
                            outLine('请输入用户名')
                            return false
                        }
                        var myreg=/^[1][3,4,5,7,8][0-9]{9}$/
                        if(!phone||!myreg.test(phone)){
                            outLine('手机号码有误')
                            return false
                        }
                    }
                    if(report_type==0){
                        outLine('请选择类型')
                        return false
                    }
                    if(!description_info){
                        outLine('内容不能为空')
                        return false
                    }
                    if(area_id==0){
                        outLine('请选择类型')
                        return false
                    }
                    var upzxjbdata={
                        title:"提交在线举报",
                        url:"index/saveProsecute",
                        arrname:"zxjbImages",
                        fromwho:'lj',
                        sendData:{
                            user:user,
                            phone:phone,
                            description_info:description_info,
                            report_type:report_type,
                            area:area_id,
                            type:"add",
                        }
                    }
                    console.log(upzxjbdata)
//                  return false;
//                  upAjax(upzxjbdata,function(){},function(){})
                    mui.plusReady(function() {
                        upDataPlus(upzxjbdata)
                    });
                })
            },
            function(){
                
            }
        )        //  console.log(upzxjbdata)
    }
    /*
     ** tab4**
     */
    if(tabIndex=='tab4'){
//      判断是否登录
        var issid={
            url:'user/ssoLogin',
            fromwho:'ch'
        }
        getAjax(issid,
            function(data){
                if(data.result!=1){
                    window.location.href="login.html"
                }else{
                    var showrole={
                        url:'service/userRoleRead',
                        fromwho:'ch'
                    }
                    getAjax(showrole,function(data){var usertypestring=JSON.stringify(data.data);localStorage.setItem('usertype',usertypestring)},function(){})
                    var adminname=userInfo.realname ? userInfo.realname :userInfo.userid;
                    var admintel
                    if(userInfo.mtel){
                       admintel=userInfo.mtel.toString()
                       admintel=admintel.substr(0, 3) + '****' + admintel.substr(7);
                    }else{
                        admintel='请添加的手机号'
                    }
                    $('.headerName .hnpName').html(adminname)
                    $('.headerName .hnpPhone').html(admintel)
                }
            },
            function(data){
                
            }
        )
    }
    
    
    
}
//新闻渲染数据
function setNewsData(data,cid,isAppend){
	var html='';
	var tplData={curData:data}
    html = template('tpl-newsList', tplData);
	if (isAppend) {
		$('#news-list .data-list[data-cid='+cid+']').append(html)//加在列表的后面,上拉加载
	} else{
		$('#news-list .data-list[data-cid='+cid+']').html(html);//加在列表的前面,下拉刷新
	}
}
//司法渲染数据
function setJudiciaryData(data,isAppend){
	var html='';
	var tplData={curData:data}
	html = template('tpl-sfjzList', tplData);
	if (isAppend) {
		$('#sfjzList').append(html)//加在列表的后面,上拉加载
	} else{
		$('#sfjzList').html(html);//加在列表的前面,下拉刷新
	}
}


/************获取数据对象end**********/

/************页面跳转***************/
//心理咨询师
mui(".mui-content").on('tap','.menuOne.left',function(){
	mui.openWindow({
		url:'psychology.html',
	    id:'psychology.html'
	});
})
//法律咨询
mui(".mui-content").on('tap','.menuOne.right',function(){
	mui.openWindow({
		url:'law.html',
	    id:'law.html'			    
	});
})
//点击打开单条新闻
mui(".data-list").on('tap','.newsOne,.sfzjOne',function(){
	var id=$(this).attr('id');
	mui.openWindow({
		url:`newsDetail.html?id=${id}`,
	    id:'newsDetail.html',
	    styles: {
		    titleNView: { 
			    backgroundColor: '#006EC3',//导航栏背景色
			    titleText: '这里显示内容的标题',//导航栏标题
			    titleColor: '#fff',//文字颜色
			    type:'transparent',//透明渐变样式
			    autoBackButton: true,//自动绘制返回箭头
		    }
		}
	});
})
//司法救助更多功能
mui("header").on('tap','svg.icon.yiwen',function(){
	mui.openWindow({
		url:'judicial.html',
	    id:'judicial.html',
	});
})
//点击打开单条司法救助
//mui(".sfjzList").on('tap','.sfzjOne',function(){
//	var id=$(this).attr('id');
//	mui.openWindow({
//		url:`judiciaryDetail.html?id=${id}`,
//	    id:'judiciaryDetail.html',
//	    styles: {
//		    titleNView: { 
//			    backgroundColor: '#006EC3',//导航栏背景色
//			    titleText: '这里显示内容的标题',//导航栏标题
//			    titleColor: '#fff',//文字颜色
//			    type:'transparent',//透明渐变样式
//			    autoBackButton: true,//自动绘制返回箭头
//		    }
//		}
//	});
//})
//打开举报协议
mui(".mui-content").on('tap','svg.icon.jbxy',function(){
	mui.openWindow({
		url:'jbxy.html',
	    id:'jbxy.html',
	});
})
//进入办案系统
mui(".mui-content").on('tap','.banan',function(){
    var utype=JSON.parse(localStorage.getItem('usertype'))
    if($.inArray('workPeople',utype)==-1){
        mui.openWindow({
            url:'businessMain.html',
            id:'businessMain.html',
        });
    }else{
        mui.openWindow({
            url:'caseMain.html',
            id:'caseMain.html',
        });
    }
})
//非办案人员进入办案系统
mui(".mui-content").on('tap','.noBanan',function(){
	mui.openWindow({
		url:'businessMain.html',
	    id:'businessMain.html',
	});
})
//进入基本信息
mui(".mui-content").on('click','.otherMenu.jbxx',function(){
	mui.openWindow({
		url:'information.html',
	    id:'information.html',
	    createNew:true,
	});
})
mui(".mui-content").on('tap','.hnNamePhone',function(){
	mui.openWindow({
		url:'information.html',
	    id:'information.html',
	    createNew:true,
	});
})
mui(".mui-content").on('tap','svg.icon.my',function(){
	mui.openWindow({
		url:'information.html',
	    id:'information.html',
	    createNew:true,
	});
})
//进入安全信息
mui(".mui-content").on('tap','.otherMenu.aqxx',function(){
	mui.openWindow({
		url:'security.html',
	    id:'security.html',
	    createNew:true,
	});
})
//进入我的举报
mui(".mui-content").on('tap','.otherMenu.wdjb',function(){
	mui.openWindow({
		url:'myReport.html',
	    id:'myReport.html',
	});
})
//进入我的咨询
mui(".mui-content").on('tap','.otherMenu.wdzx',function(){
	mui.openWindow({
		url:'myConsultation.html',
	    id:'myConsultation.html',
	});
})
//进入系统消息
mui(".mui-content").on('tap','.otherMenu.xtxx',function(){
	mui.openWindow({
		url:'systemInfo.html',
	    id:'systemInfo.html',
	});
})
//进入
mui(".mui-content").on('tap','.otherMenu.userxx',function(){
    mui.openWindow({
        url:'login.html',
        id:'login.html',
        createNew:true,
    });
})

/************页面跳转end***************/




/************其他方法***************/
/**
 * 举报(tab3)
 */
mui('.mui-bar-tab').on('tap','#tab3',function(){
	clearZxjbData()
});
function clearZxjbData(){
	$(".jbMain input").val("");
	$(".jbMain textarea").val("");
	$(".jbMain #type").val(0);
	$(".zxjbimage-item").remove();
	zxjbImages=[]
}


//获取树
function getAreaTree(){
    var getAreaTree={
        url:'org/treeOrgArea',
        fromwho:'ch',
    }
    getAjax(getAreaTree,
        function(data){
            if(data.result==1){
                var curData=data.data
                setAreaTree(curData)
            }
        },
        function(data){
            console.log(data)
        }
    )
    function  setAreaTree(curData){
        var curMenu = null, zTree_Menu = null;
        var setting = {
            view: {
                showLine: false,
                showIcon: false,
                selectedMulti: false,
                dblClickExpand: false,
            },
            data: {
                key: {
                    children: "nodes",
                    name: "text"
                }
            },
            callback: {
                beforeClick: beforeClick,
            }
        };
        var zNodes =curData
        function beforeClick(treeId, treeNode) {
            $('#selceted-areaid').val(treeNode.id)
            if (treeNode.level == 0 ) {
                var zTree = $.fn.zTree.getZTreeObj("treeDemo");
                zTree.expandNode(treeNode);
                return false;
            }
            return true;
        }
        $(document).ready(function(){
            var treeObj = $("#treeDemo");
            $.fn.zTree.init(treeObj, setting, zNodes);
        });

    }
}
/***********上传图片***********/
//选取图片的来源，拍照和相册  
function showActionSheet(obj){  
      var divid = obj.id;  
      var actionbuttons=[{title:"拍照"},{title:"相册选取"}];  
      var actionstyle={title:"选择照片",cancel:"取消",buttons:actionbuttons};  
      plus.nativeUI.actionSheet(actionstyle, function(e){  
            if(e.index==1){  
                getImage(divid);  
            }else if(e.index==2){  
                galleryImg(divid);  
            }  
      } );  
} 
//调用相册
var zxjbImages=[]//在线举报文件组，需要与传值一致
function galleryImg(divid){
    plus.gallery.pick(
        function(e){
            $.each(e.files, function(k,v) {
                plus.io.resolveLocalFileSystemURL(v, 
                    function(entry) {
                        compressImage(entry.toLocalURL(),entry.name,divid); 
                    }, 
                    function(e) {
                       plus.nativeUI.toast("读取拍照文件错误：" + e.message);
                    }
                );
            });
        }, 
        function ( e ) {
        },
        {
            filename: "_doc/camera/",
            filter:"image",
            multiple:true
        }
    );
}
function getImage(divid) {  
    var cmr = plus.camera.getCamera();  
    cmr.captureImage(function(p) {  
        plus.io.resolveLocalFileSystemURL(p, function(entry) {  
            compressImage(entry.toLocalURL(),entry.name,divid);  
        }, function(e) {  
            plus.nativeUI.toast("读取拍照文件错误：" + e.message);  
        });  
    }, function(e) {  
    }, {  
        filename: "_doc/camera/",  
        index: 1  
    });  
}  
//压缩图片
function compressImage(url,filename,divid){  
    var name="_doc/upload/"+divid+"-"+filename;
    plus.zip.compressImage(
        {
            src:url,//src: (String 类型 )压缩转换原始图片的路径  
            dst:name,//压缩转换目标图片的路径  
            quality:40,//quality: (Number 类型 )压缩图片的质量.取值范围为1-100  
            overwrite:true//overwrite: (Boolean 类型 )覆盖生成新文件  
        },  
        function(event) {
            var path = name;//压缩转换目标图片的路径  
            saveimage(event.target,divid,filename,path);  
        },
        function(error) {
            plus.nativeUI.toast("压缩图片失败，请稍候再试"); 
        }
    );  
}
//保存图片
function saveimage(url,divid,name,path){  
     //alert(url);//file:///storage/emulated/0/Android/data/io.dcloud...../doc/upload/F_ZDDZZ-1467602809090.jpg  
    //alert(path);//_doc/upload/F_ZDDZZ-1467602809090.jpg  
    var  state=0;  
    var wt = plus.nativeUI.showWaiting();  
  //  plus.storage.clear();   
    name=name.substring(0,name.indexOf("."));//图片名称：1467602809090  
    zxjbImages.push({name:name,path:path,url:url}) 
    showImgDetail(name,divid,url);  
    wt.close();  
      
}
//渲染图片
function showImgDetail (imgId,divId,src) {    
    var html = "";  
    var classname="zxjbimage-item";
    html=`
        <div  id="${imgId}" class="${classname}">
            <img id="picBig" data-preview-src="" data-preview-group="1" src="${src}"/>
            <span class="del" onclick="delImg('${imgId}','${divId}')">
                 <i class="icon iconfont icon-ziliao"></i>
            </span>
        </div>
    `
    $(`#${divId}`).before(html);
    //delImg('${imgId}','${imgkey}');
}
//删除图片
function delImg(imgId,divId){  
    var bts = ["是", "否"];  
    plus.nativeUI.confirm("是否删除图片？", function(e) {  
            var i = e.index;  
            if (i == 0) {  
                var imgname=imgId;
                console.log(zxjbImages)
                $.each(zxjbImages,function(k,v){
                    if(v.name==imgname){
                        zxjbImages.splice(k,1)
                        $(`#${imgname}`).remove();  
                        return false
                    }
                })
                console.log(zxjbImages)
            }  
        },"请问", bts);  
}
function upDataPlus(data){
    var url=data.url ? data.url:'';
    var sendData=data.sendData ? data.sendData:'';
    var arrname=data.arrname ? data.arrname:'';
    var fileList=eval(arrname)
    if(!fileList){
        return false
    }
    console.log(httpurl(url,'lj'))
    var wt = plus.nativeUI.showWaiting();  
    var task = plus.uploader.createUpload(httpurl(url,'lj'),{ method:"POST"}, 
        function ( t, status ) {  
            if ( status == 200 ) {  
                mui.toast("上传成功");
//              alert(t.responseText)
                /****清空数据end****/
                clearZxjbData()
                /****清空数据end****/
                wt.close();  
            }else {  
                mui.toast( "上传失败:" + t.responseText); 
                wt.close();  
            }  
        }  
    );  
    $.each(sendData,function(k,v){
        task.addData(k,v); 
        console.log(k+":"+v)
    })
//  if(zxjbImages.length>0){
    if(fileList.length>0){
        $.each(fileList,function(k,v){
            var imgurl=v.url
            console.log(imgurl)
            task.addFile(imgurl,{key:"file[]"});  
        })
    } 
    task.start();  
}
/***********上传图片end***********/
/************其他方法end***************/